package com.tyc.mb;

import afu.org.checkerframework.checker.oigj.qual.O;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.lang.reflect.Field;
import java.util.Map;

/**
 *
 * @author tyc
 * @version 1.0
 * @date 2021-10-25 13:41:08
 */

@SpringBootApplication
@MapperScan(basePackages = {"com.tyc.mb.mapper"})
public class MyBatisApplication {
    public static void main(String[] args) throws Exception {
        SpringApplication application = new SpringApplication(MyBatisApplication.class);
        ConfigurableApplicationContext context = application.run(args);

//        Field singletonObjects = DefaultSingletonBeanRegistry.class.getDeclaredField("singletonObjects");
//        singletonObjects.setAccessible(true);
//        ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
//        Map<String, Object> map = (Map<String, Object>)singletonObjects.get(beanFactory);
//        map.forEach((k,v)-> System.out.println(k + "=" + v));
    }
}
